# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=brosec
pkgver=278.c51164f
pkgrel=1
groups=('blackarch' 'blackarch-exploitation')
pkgdesc='An interactive reference tool to help security professionals utilize useful payloads and commands.'
url='https://github.com/gabemarshall/Brosec'
arch=('x86_64' 'aarch64')
license=('custom:unknown')
depends=('nodejs' 'xsel')
makedepends=('git' 'npm')
source=("$pkgname::git+https://github.com/gabemarshall/Brosec.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package(){
  cd $pkgname

  local _npmdir="$pkgdir/usr/lib/node_modules/"

  install -dm 755 "$_npmdir"
  install -dm 755 "$pkgdir/usr/share/doc/$pkgname"

  cd "$_npmdir"

  npm install --user root -g --prefix "$pkgdir/usr" Brosec@

  cd "$srcdir/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" README.md CHANGELOG.md
}

